package com.yanmushi.ms.api.dlc;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;

import java.util.Arrays;

/**
 * @auther yinlei
 * @date 2018/1/22
 * @since 1.0.0
 */
@SpringBootApplication
@EnableAutoConfiguration
public class ApiDlcApplication {

    private static final Logger log = LoggerFactory.getLogger(ApiDlcApplication.class);

    public static void main(String[] args) {
        SpringApplication.run(ApiDlcApplication.class, args);
    }

    @Bean
    public CommandLineRunner commandLineRunner(ApplicationContext context) {
        return args -> {
            String[] beanNames = context.getBeanDefinitionNames();

            Arrays.sort(beanNames);

            for (String beanname : beanNames) {
                log.debug(beanname);
            }
        };
    }

}
